package com.clqteam.daoimpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.clqteam.dao.UpdateEmployeeDao;
import com.clqteam.util.JDBCutil;

public class UpdateEmployeeDaoImpl implements UpdateEmployeeDao{

	@Override
	public boolean updateEmployeeInfo(String eAccount,String ePsw,String eName,int eId,int rId) {
		boolean bo=false;
		StringBuffer sql=new StringBuffer();
		sql.append(" UPDATE s_employee SET s_employee.eAccount=?,s_employee.eName=?,");
		sql.append(" s_employee.ePsw=?,s_employee.rId=?");
		sql.append(" WHERE s_employee.eId=?");
		Connection con=JDBCutil.getConnection();
		try {
			PreparedStatement pst=con.prepareStatement(sql.toString());
			pst.setString(1, eAccount);
			pst.setString(2, eName);
			pst.setString(3,ePsw);
			pst.setInt(4, rId);
			pst.setInt(5,eId);
			int i=pst.executeUpdate();
			if(i>0){
				bo=true;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return bo;
		
	}

	@Override
	public boolean insertUpdateDailyreport(String drTime, String drInfo, int eId) {
		// TODO Auto-generated method stub
		return false;
	}

}
